#include<iostream>
using namespace std;
/*
void PreOrder(BinTree* T)
{
	if (T != NULL)
	{
		Stack s;
		Init_Stack(&s);
		BinTree* p;
		Push_Stack(&s, T);
		while (!Empty_Stack(s))
		{
			p = Get_Stack(&s);
			Pop_Stack(&s);
			if (p->rchilde != NULL) {
				Push_Stack(&s, p->rchild);
			}
			if (p->lchild != NULL) {
				Push_Stack(&s, p->lchild);
			}
		}
	}
}
*/
void MidOrder(BinTree* T)
{
	if (T != NULL)
	{
		Stack s;
		Init_Stack(&s);
		BinTree* p = T;
		Push_Stack(&s, T);
		while (!Empty_Stak(s))
		{
			while (T != NULL && T->lchild != NULL)
			{
				Push_Stack(&s, T->lchild);
			}
			p = Get_Stack(&s);
			Pop_Stack(&s);
			if (p->rchild != NULL)
			{
				t = p->rchild;
				if (t != NULL)
				{
					Push_Stack(&s, t);
				}
			}
		}
	}
}